package com.usian.admin.controller.v1;

import com.usian.admin.service.AdSensitiveService;

import com.usian.apis.admin.AdSensitiveControllerApi;

import com.usian.model.admin.dtos.SensitiveDto;

import com.usian.model.admin.pojos.AdSensitive;

import com.usian.model.common.dtos.ResponseResult;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/api/v1/AdSensitive")
public class AdSensitiveController implements AdSensitiveControllerApi {
    @Autowired
    private AdSensitiveService adSensitiveService;

    @PostMapping("/list")
    @Override
    public ResponseResult findPage(@RequestBody SensitiveDto dto) {
        return adSensitiveService.findPage(dto);
    }

    @PostMapping("/save")
    @Override
    public ResponseResult save(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.saveAdSensitive(adSensitive);
    }

    @DeleteMapping("/del/{id}")
    @Override
    public ResponseResult del(@PathVariable("id") Integer id) {
        return adSensitiveService.del(id);
    }


    @PostMapping("/dels")
    @Override
    public ResponseResult dels(@RequestBody Integer[] ids) {
        return adSensitiveService.dels(ids);
    }

    @PutMapping("/update")
    @Override
    public ResponseResult update(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.update(adSensitive);
    }


    @GetMapping("/findById/{id}")
    @Override
    public ResponseResult findById(@PathVariable("id") Integer id) {
        return adSensitiveService.findById(id);
    }

}
